#include "trilogy/charset.h"

static TRILOGY_ENCODING_t charset_to_encoding_map[] = {
    [TRILOGY_CHARSET_NONE] = TRILOGY_ENCODING_NONE,
    [TRILOGY_CHARSET_BIG5_CHINESE_CI] = TRILOGY_ENCODING_BIG5,
    [TRILOGY_CHARSET_BIG5_BIN] = TRILOGY_ENCODING_BIG5,
    [TRILOGY_CHARSET_LATIN2_CZECH_CS] = TRILOGY_ENCODING_LATIN2,
    [TRILOGY_CHARSET_LATIN2_GENERAL_CI] = TRILOGY_ENCODING_LATIN2,
    [TRILOGY_CHARSET_LATIN2_HUNGARIAN_CI] = TRILOGY_ENCODING_LATIN2,
    [TRILOGY_CHARSET_LATIN2_CROATIAN_CI] = TRILOGY_ENCODING_LATIN2,
    [TRILOGY_CHARSET_LATIN2_BIN] = TRILOGY_ENCODING_LATIN2,
    [TRILOGY_CHARSET_DEC8_SWEDISH_CI] = TRILOGY_ENCODING_DEC8,
    [TRILOGY_CHARSET_DEC8_BIN] = TRILOGY_ENCODING_DEC8,
    [TRILOGY_CHARSET_CP850_GENERAL_CI] = TRILOGY_ENCODING_CP850,
    [TRILOGY_CHARSET_CP850_BIN] = TRILOGY_ENCODING_CP850,
    [TRILOGY_CHARSET_LATIN1_GERMAN1_CI] = TRILOGY_ENCODING_LATIN1,
    [TRILOGY_CHARSET_LATIN1_SWEDISH_CI] = TRILOGY_ENCODING_LATIN1,
    [TRILOGY_CHARSET_LATIN1_DANISH_CI] = TRILOGY_ENCODING_LATIN1,
    [TRILOGY_CHARSET_LATIN1_GERMAN2_CI] = TRILOGY_ENCODING_LATIN1,
    [TRILOGY_CHARSET_LATIN1_BIN] = TRILOGY_ENCODING_LATIN1,
    [TRILOGY_CHARSET_LATIN1_GENERAL_CI] = TRILOGY_ENCODING_LATIN1,
    [TRILOGY_CHARSET_LATIN1_GENERAL_CS] = TRILOGY_ENCODING_LATIN1,
    [TRILOGY_CHARSET_LATIN1_SPANISH_CI] = TRILOGY_ENCODING_LATIN1,
    [TRILOGY_CHARSET_HP8_ENGLISH_CI] = TRILOGY_ENCODING_HP8,
    [TRILOGY_CHARSET_HP8_BIN] = TRILOGY_ENCODING_HP8,
    [TRILOGY_CHARSET_KOI8R_GENERAL_CI] = TRILOGY_ENCODING_KOI8R,
    [TRILOGY_CHARSET_KOI8R_BIN] = TRILOGY_ENCODING_KOI8R,
    [TRILOGY_CHARSET_SWE7_SWEDISH_CI] = TRILOGY_ENCODING_SWE7,
    [TRILOGY_CHARSET_SWE7_BIN] = TRILOGY_ENCODING_SWE7,
    [TRILOGY_CHARSET_ASCII_GENERAL_CI] = TRILOGY_ENCODING_ASCII,
    [TRILOGY_CHARSET_ASCII_BIN] = TRILOGY_ENCODING_ASCII,
    [TRILOGY_CHARSET_UJIS_JAPANESE_CI] = TRILOGY_ENCODING_UJIS,
    [TRILOGY_CHARSET_UJIS_BIN] = TRILOGY_ENCODING_UJIS,
    [TRILOGY_CHARSET_SJIS_JAPANESE_CI] = TRILOGY_ENCODING_SJIS,
    [TRILOGY_CHARSET_SJIS_BIN] = TRILOGY_ENCODING_SJIS,
    [TRILOGY_CHARSET_CP1251_BULGARIAN_CI] = TRILOGY_ENCODING_CP1251,
    [TRILOGY_CHARSET_CP1251_UKRAINIAN_CI] = TRILOGY_ENCODING_CP1251,
    [TRILOGY_CHARSET_CP1251_BIN] = TRILOGY_ENCODING_CP1251,
    [TRILOGY_CHARSET_CP1251_GENERAL_CI] = TRILOGY_ENCODING_CP1251,
    [TRILOGY_CHARSET_CP1251_GENERAL_CS] = TRILOGY_ENCODING_CP1251,
    [TRILOGY_CHARSET_HEBREW_GENERAL_CI] = TRILOGY_ENCODING_HEBREW,
    [TRILOGY_CHARSET_HEBREW_BIN] = TRILOGY_ENCODING_HEBREW,
    [TRILOGY_CHARSET_TIS620_THAI_CI] = TRILOGY_ENCODING_TIS620,
    [TRILOGY_CHARSET_TIS620_BIN] = TRILOGY_ENCODING_TIS620,
    [TRILOGY_CHARSET_EUCKR_KOREAN_CI] = TRILOGY_ENCODING_EUCKR,
    [TRILOGY_CHARSET_EUCKR_BIN] = TRILOGY_ENCODING_EUCKR,
    [TRILOGY_CHARSET_LATIN7_ESTONIAN_CS] = TRILOGY_ENCODING_LATIN7,
    [TRILOGY_CHARSET_LATIN7_GENERAL_CI] = TRILOGY_ENCODING_LATIN7,
    [TRILOGY_CHARSET_LATIN7_GENERAL_CS] = TRILOGY_ENCODING_LATIN7,
    [TRILOGY_CHARSET_LATIN7_BIN] = TRILOGY_ENCODING_LATIN7,
    [TRILOGY_CHARSET_KOI8U_GENERAL_CI] = TRILOGY_ENCODING_KOI8U,
    [TRILOGY_CHARSET_KOI8U_BIN] = TRILOGY_ENCODING_KOI8U,
    [TRILOGY_CHARSET_GB2312_CHINESE_CI] = TRILOGY_ENCODING_GB2312,
    [TRILOGY_CHARSET_GB2312_BIN] = TRILOGY_ENCODING_GB2312,
    [TRILOGY_CHARSET_GREEK_GENERAL_CI] = TRILOGY_ENCODING_GREEK,
    [TRILOGY_CHARSET_GREEK_BIN] = TRILOGY_ENCODING_GREEK,
    [TRILOGY_CHARSET_CP1250_GENERAL_CI] = TRILOGY_ENCODING_CP1250,
    [TRILOGY_CHARSET_CP1250_CZECH_CS] = TRILOGY_ENCODING_CP1250,
    [TRILOGY_CHARSET_CP1250_CROATIAN_CI] = TRILOGY_ENCODING_CP1250,
    [TRILOGY_CHARSET_CP1250_BIN] = TRILOGY_ENCODING_CP1250,
    [TRILOGY_CHARSET_CP1250_POLISH_CI] = TRILOGY_ENCODING_CP1250,
    [TRILOGY_CHARSET_GBK_CHINESE_CI] = TRILOGY_ENCODING_GBK,
    [TRILOGY_CHARSET_GBK_BIN] = TRILOGY_ENCODING_GBK,
    [TRILOGY_CHARSET_GB18030_CHINESE_CI] = TRILOGY_ENCODING_GBK,
    [TRILOGY_CHARSET_GB18030_BIN_CI] = TRILOGY_ENCODING_GBK,
    [TRILOGY_CHARSET_GB18030_UNICODE_520_CI] = TRILOGY_ENCODING_GBK,
    [TRILOGY_CHARSET_CP1257_LITHUANIAN_CI] = TRILOGY_ENCODING_CP1257,
    [TRILOGY_CHARSET_CP1257_BIN] = TRILOGY_ENCODING_CP1257,
    [TRILOGY_CHARSET_CP1257_GENERAL_CI] = TRILOGY_ENCODING_CP1257,
    [TRILOGY_CHARSET_LATIN5_TURKISH_CI] = TRILOGY_ENCODING_LATIN5,
    [TRILOGY_CHARSET_LATIN5_BIN] = TRILOGY_ENCODING_LATIN5,
    [TRILOGY_CHARSET_ARMSCII8_GENERAL_CI] = TRILOGY_ENCODING_ARMSCII8,
    [TRILOGY_CHARSET_ARMSCII8_BIN] = TRILOGY_ENCODING_ARMSCII8,
    [TRILOGY_CHARSET_UTF8_GENERAL_CI] = TRILOGY_ENCODING_UTF8,
    [TRILOGY_CHARSET_UTF8_BIN] = TRILOGY_ENCODING_UTF8,
    [TRILOGY_CHARSET_UTF8_UNICODE_CI] = TRILOGY_ENCODING_UTF8,
    [TRILOGY_CHARSET_UTF8_ICELANDIC_CI] = TRILOGY_ENCODING_UTF8,
    [TRILOGY_CHARSET_UTF8_LATVIAN_CI] = TRILOGY_ENCODING_UTF8,
    [TRILOGY_CHARSET_UTF8_ROMANIAN_CI] = TRILOGY_ENCODING_UTF8,
    [TRILOGY_CHARSET_UTF8_SLOVENIAN_CI] = TRILOGY_ENCODING_UTF8,
    [TRILOGY_CHARSET_UTF8_POLISH_CI] = TRILOGY_ENCODING_UTF8,
    [TRILOGY_CHARSET_UTF8_ESTONIAN_CI] = TRILOGY_ENCODING_UTF8,
    [TRILOGY_CHARSET_UTF8_SPANISH_CI] = TRILOGY_ENCODING_UTF8,
    [TRILOGY_CHARSET_UTF8_SWEDISH_CI] = TRILOGY_ENCODING_UTF8,
    [TRILOGY_CHARSET_UTF8_TURKISH_CI] = TRILOGY_ENCODING_UTF8,
    [TRILOGY_CHARSET_UTF8_CZECH_CI] = TRILOGY_ENCODING_UTF8,
    [TRILOGY_CHARSET_UTF8_DANISH_CI] = TRILOGY_ENCODING_UTF8,
    [TRILOGY_CHARSET_UTF8_LITHUANIAN_CI] = TRILOGY_ENCODING_UTF8,
    [TRILOGY_CHARSET_UTF8_SLOVAK_CI] = TRILOGY_ENCODING_UTF8,
    [TRILOGY_CHARSET_UTF8_SPANISH2_CI] = TRILOGY_ENCODING_UTF8,
    [TRILOGY_CHARSET_UTF8_ROMAN_CI] = TRILOGY_ENCODING_UTF8,
    [TRILOGY_CHARSET_UTF8_PERSIAN_CI] = TRILOGY_ENCODING_UTF8,
    [TRILOGY_CHARSET_UTF8_ESPERANTO_CI] = TRILOGY_ENCODING_UTF8,
    [TRILOGY_CHARSET_UTF8_HUNGARIAN_CI] = TRILOGY_ENCODING_UTF8,
    [TRILOGY_CHARSET_UTF8_SINHALA_CI] = TRILOGY_ENCODING_UTF8,
    [TRILOGY_CHARSET_UTF8_GENERAL_MYSQL500_CI] = TRILOGY_ENCODING_UTF8,
    [TRILOGY_CHARSET_UCS2_GENERAL_CI] = TRILOGY_ENCODING_UCS2,
    [TRILOGY_CHARSET_UCS2_BIN] = TRILOGY_ENCODING_UCS2,
    [TRILOGY_CHARSET_UCS2_UNICODE_CI] = TRILOGY_ENCODING_UCS2,
    [TRILOGY_CHARSET_UCS2_ICELANDIC_CI] = TRILOGY_ENCODING_UCS2,
    [TRILOGY_CHARSET_UCS2_LATVIAN_CI] = TRILOGY_ENCODING_UCS2,
    [TRILOGY_CHARSET_UCS2_ROMANIAN_CI] = TRILOGY_ENCODING_UCS2,
    [TRILOGY_CHARSET_UCS2_SLOVENIAN_CI] = TRILOGY_ENCODING_UCS2,
    [TRILOGY_CHARSET_UCS2_POLISH_CI] = TRILOGY_ENCODING_UCS2,
    [TRILOGY_CHARSET_UCS2_ESTONIAN_CI] = TRILOGY_ENCODING_UCS2,
    [TRILOGY_CHARSET_UCS2_SPANISH_CI] = TRILOGY_ENCODING_UCS2,
    [TRILOGY_CHARSET_UCS2_SWEDISH_CI] = TRILOGY_ENCODING_UCS2,
    [TRILOGY_CHARSET_UCS2_TURKISH_CI] = TRILOGY_ENCODING_UCS2,
    [TRILOGY_CHARSET_UCS2_CZECH_CI] = TRILOGY_ENCODING_UCS2,
    [TRILOGY_CHARSET_UCS2_DANISH_CI] = TRILOGY_ENCODING_UCS2,
    [TRILOGY_CHARSET_UCS2_LITHUANIAN_CI] = TRILOGY_ENCODING_UCS2,
    [TRILOGY_CHARSET_UCS2_SLOVAK_CI] = TRILOGY_ENCODING_UCS2,
    [TRILOGY_CHARSET_UCS2_SPANISH2_CI] = TRILOGY_ENCODING_UCS2,
    [TRILOGY_CHARSET_UCS2_ROMAN_CI] = TRILOGY_ENCODING_UCS2,
    [TRILOGY_CHARSET_UCS2_PERSIAN_CI] = TRILOGY_ENCODING_UCS2,
    [TRILOGY_CHARSET_UCS2_ESPERANTO_CI] = TRILOGY_ENCODING_UCS2,
    [TRILOGY_CHARSET_UCS2_HUNGARIAN_CI] = TRILOGY_ENCODING_UCS2,
    [TRILOGY_CHARSET_UCS2_SINHALA_CI] = TRILOGY_ENCODING_UCS2,
    [TRILOGY_CHARSET_UCS2_GENERAL_MYSQL500_CI] = TRILOGY_ENCODING_UCS2,
    [TRILOGY_CHARSET_CP866_GENERAL_CI] = TRILOGY_ENCODING_CP866,
    [TRILOGY_CHARSET_CP866_BIN] = TRILOGY_ENCODING_CP866,
    [TRILOGY_CHARSET_KEYBCS2_GENERAL_CI] = TRILOGY_ENCODING_KEYBCS2,
    [TRILOGY_CHARSET_KEYBCS2_BIN] = TRILOGY_ENCODING_KEYBCS2,
    [TRILOGY_CHARSET_MACCE_GENERAL_CI] = TRILOGY_ENCODING_MACCE,
    [TRILOGY_CHARSET_MACCE_BIN] = TRILOGY_ENCODING_MACCE,
    [TRILOGY_CHARSET_MACROMAN_GENERAL_CI] = TRILOGY_ENCODING_MACROMAN,
    [TRILOGY_CHARSET_MACROMAN_BIN] = TRILOGY_ENCODING_MACROMAN,
    [TRILOGY_CHARSET_CP852_GENERAL_CI] = TRILOGY_ENCODING_CP852,
    [TRILOGY_CHARSET_CP852_BIN] = TRILOGY_ENCODING_CP852,
    [TRILOGY_CHARSET_UTF8MB4_GENERAL_CI] = TRILOGY_ENCODING_UTF8MB4,
    [TRILOGY_CHARSET_UTF8MB4_BIN] = TRILOGY_ENCODING_UTF8MB4,
    [TRILOGY_CHARSET_UTF8MB4_UNICODE_CI] = TRILOGY_ENCODING_UTF8MB4,
    [TRILOGY_CHARSET_UTF8MB4_ICELANDIC_CI] = TRILOGY_ENCODING_UTF8MB4,
    [TRILOGY_CHARSET_UTF8MB4_LATVIAN_CI] = TRILOGY_ENCODING_UTF8MB4,
    [TRILOGY_CHARSET_UTF8MB4_ROMANIAN_CI] = TRILOGY_ENCODING_UTF8MB4,
    [TRILOGY_CHARSET_UTF8MB4_SLOVENIAN_CI] = TRILOGY_ENCODING_UTF8MB4,
    [TRILOGY_CHARSET_UTF8MB4_POLISH_CI] = TRILOGY_ENCODING_UTF8MB4,
    [TRILOGY_CHARSET_UTF8MB4_ESTONIAN_CI] = TRILOGY_ENCODING_UTF8MB4,
    [TRILOGY_CHARSET_UTF8MB4_SPANISH_CI] = TRILOGY_ENCODING_UTF8MB4,
    [TRILOGY_CHARSET_UTF8MB4_SWEDISH_CI] = TRILOGY_ENCODING_UTF8MB4,
    [TRILOGY_CHARSET_UTF8MB4_TURKISH_CI] = TRILOGY_ENCODING_UTF8MB4,
    [TRILOGY_CHARSET_UTF8MB4_CZECH_CI] = TRILOGY_ENCODING_UTF8MB4,
    [TRILOGY_CHARSET_UTF8MB4_DANISH_CI] = TRILOGY_ENCODING_UTF8MB4,
    [TRILOGY_CHARSET_UTF8MB4_LITHUANIAN_CI] = TRILOGY_ENCODING_UTF8MB4,
    [TRILOGY_CHARSET_UTF8MB4_SLOVAK_CI] = TRILOGY_ENCODING_UTF8MB4,
    [TRILOGY_CHARSET_UTF8MB4_SPANISH2_CI] = TRILOGY_ENCODING_UTF8MB4,
    [TRILOGY_CHARSET_UTF8MB4_ROMAN_CI] = TRILOGY_ENCODING_UTF8MB4,
    [TRILOGY_CHARSET_UTF8MB4_PERSIAN_CI] = TRILOGY_ENCODING_UTF8MB4,
    [TRILOGY_CHARSET_UTF8MB4_ESPERANTO_CI] = TRILOGY_ENCODING_UTF8MB4,
    [TRILOGY_CHARSET_UTF8MB4_HUNGARIAN_CI] = TRILOGY_ENCODING_UTF8MB4,
    [TRILOGY_CHARSET_UTF8MB4_SINHALA_CI] = TRILOGY_ENCODING_UTF8MB4,
    [TRILOGY_CHARSET_UTF8MB4_GERMAN2_CI] = TRILOGY_ENCODING_UTF8MB4,
    [TRILOGY_CHARSET_UTF8MB4_CROATIAN_CI] = TRILOGY_ENCODING_UTF8MB4,
    [TRILOGY_CHARSET_UTF8MB4_UNICODE_520_CI] = TRILOGY_ENCODING_UTF8MB4,
    [TRILOGY_CHARSET_UTF8MB4_VIETNAMESE_CI] = TRILOGY_ENCODING_UTF8MB4,
    [TRILOGY_CHARSET_UTF8MB4_0900_AI_CI] = TRILOGY_ENCODING_UTF8MB4,
    [TRILOGY_CHARSET_UTF16_GENERAL_CI] = TRILOGY_ENCODING_UTF16,
    [TRILOGY_CHARSET_UTF16_BIN] = TRILOGY_ENCODING_UTF16,
    [TRILOGY_CHARSET_UTF16_UNICODE_CI] = TRILOGY_ENCODING_UTF16,
    [TRILOGY_CHARSET_UTF16_ICELANDIC_CI] = TRILOGY_ENCODING_UTF16,
    [TRILOGY_CHARSET_UTF16_LATVIAN_CI] = TRILOGY_ENCODING_UTF16,
    [TRILOGY_CHARSET_UTF16_ROMANIAN_CI] = TRILOGY_ENCODING_UTF16,
    [TRILOGY_CHARSET_UTF16_SLOVENIAN_CI] = TRILOGY_ENCODING_UTF16,
    [TRILOGY_CHARSET_UTF16_POLISH_CI] = TRILOGY_ENCODING_UTF16,
    [TRILOGY_CHARSET_UTF16_ESTONIAN_CI] = TRILOGY_ENCODING_UTF16,
    [TRILOGY_CHARSET_UTF16_SPANISH_CI] = TRILOGY_ENCODING_UTF16,
    [TRILOGY_CHARSET_UTF16_SWEDISH_CI] = TRILOGY_ENCODING_UTF16,
    [TRILOGY_CHARSET_UTF16_TURKISH_CI] = TRILOGY_ENCODING_UTF16,
    [TRILOGY_CHARSET_UTF16_CZECH_CI] = TRILOGY_ENCODING_UTF16,
    [TRILOGY_CHARSET_UTF16_DANISH_CI] = TRILOGY_ENCODING_UTF16,
    [TRILOGY_CHARSET_UTF16_LITHUANIAN_CI] = TRILOGY_ENCODING_UTF16,
    [TRILOGY_CHARSET_UTF16_SLOVAK_CI] = TRILOGY_ENCODING_UTF16,
    [TRILOGY_CHARSET_UTF16_SPANISH2_CI] = TRILOGY_ENCODING_UTF16,
    [TRILOGY_CHARSET_UTF16_ROMAN_CI] = TRILOGY_ENCODING_UTF16,
    [TRILOGY_CHARSET_UTF16_PERSIAN_CI] = TRILOGY_ENCODING_UTF16,
    [TRILOGY_CHARSET_UTF16_ESPERANTO_CI] = TRILOGY_ENCODING_UTF16,
    [TRILOGY_CHARSET_UTF16_HUNGARIAN_CI] = TRILOGY_ENCODING_UTF16,
    [TRILOGY_CHARSET_UTF16_SINHALA_CI] = TRILOGY_ENCODING_UTF16,
    [TRILOGY_CHARSET_CP1256_GENERAL_CI] = TRILOGY_ENCODING_CP1256,
    [TRILOGY_CHARSET_CP1256_BIN] = TRILOGY_ENCODING_CP1256,
    [TRILOGY_CHARSET_UTF32_GENERAL_CI] = TRILOGY_ENCODING_UTF32,
    [TRILOGY_CHARSET_UTF32_BIN] = TRILOGY_ENCODING_UTF32,
    [TRILOGY_CHARSET_UTF32_UNICODE_CI] = TRILOGY_ENCODING_UTF32,
    [TRILOGY_CHARSET_UTF32_ICELANDIC_CI] = TRILOGY_ENCODING_UTF32,
    [TRILOGY_CHARSET_UTF32_LATVIAN_CI] = TRILOGY_ENCODING_UTF32,
    [TRILOGY_CHARSET_UTF32_ROMANIAN_CI] = TRILOGY_ENCODING_UTF32,
    [TRILOGY_CHARSET_UTF32_SLOVENIAN_CI] = TRILOGY_ENCODING_UTF32,
    [TRILOGY_CHARSET_UTF32_POLISH_CI] = TRILOGY_ENCODING_UTF32,
    [TRILOGY_CHARSET_UTF32_ESTONIAN_CI] = TRILOGY_ENCODING_UTF32,
    [TRILOGY_CHARSET_UTF32_SPANISH_CI] = TRILOGY_ENCODING_UTF32,
    [TRILOGY_CHARSET_UTF32_SWEDISH_CI] = TRILOGY_ENCODING_UTF32,
    [TRILOGY_CHARSET_UTF32_TURKISH_CI] = TRILOGY_ENCODING_UTF32,
    [TRILOGY_CHARSET_UTF32_CZECH_CI] = TRILOGY_ENCODING_UTF32,
    [TRILOGY_CHARSET_UTF32_DANISH_CI] = TRILOGY_ENCODING_UTF32,
    [TRILOGY_CHARSET_UTF32_LITHUANIAN_CI] = TRILOGY_ENCODING_UTF32,
    [TRILOGY_CHARSET_UTF32_SLOVAK_CI] = TRILOGY_ENCODING_UTF32,
    [TRILOGY_CHARSET_UTF32_SPANISH2_CI] = TRILOGY_ENCODING_UTF32,
    [TRILOGY_CHARSET_UTF32_ROMAN_CI] = TRILOGY_ENCODING_UTF32,
    [TRILOGY_CHARSET_UTF32_PERSIAN_CI] = TRILOGY_ENCODING_UTF32,
    [TRILOGY_CHARSET_UTF32_ESPERANTO_CI] = TRILOGY_ENCODING_UTF32,
    [TRILOGY_CHARSET_UTF32_HUNGARIAN_CI] = TRILOGY_ENCODING_UTF32,
    [TRILOGY_CHARSET_UTF32_SINHALA_CI] = TRILOGY_ENCODING_UTF32,
    [TRILOGY_CHARSET_BINARY] = TRILOGY_ENCODING_BINARY,
    [TRILOGY_CHARSET_GEOSTD8_GENERAL_CI] = TRILOGY_ENCODING_GEOSTD8,
    [TRILOGY_CHARSET_GEOSTD8_BIN] = TRILOGY_ENCODING_GEOSTD8,
    [TRILOGY_CHARSET_CP932_JAPANESE_CI] = TRILOGY_ENCODING_CP932,
    [TRILOGY_CHARSET_CP932_BIN] = TRILOGY_ENCODING_CP932,
    [TRILOGY_CHARSET_EUCJPMS_JAPANESE_CI] = TRILOGY_ENCODING_EUCJPMS,
    [TRILOGY_CHARSET_EUCJPMS_BIN] = TRILOGY_ENCODING_EUCJPMS,
};

TRILOGY_ENCODING_t trilogy_encoding_from_charset(TRILOGY_CHARSET_t charset) { return charset_to_encoding_map[charset]; }
